package com.gljx.web.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gljx.web.Entity.Positiongrade;
import com.gljx.web.dao.PositiongradeMapper;
import com.gljx.web.service.PositiongradeService;

@Service
@Transactional
public class PositiongradeServiceImpl implements PositiongradeService {
	
	@Autowired
	private PositiongradeMapper positiongradeMapper;
	/**
	 * 查找全部职级职等信息
	 */
	@Override
	public List<Positiongrade> selectPosttiongradeList(String fcompanyid) {
		// TODO Auto-generated method stub
		return positiongradeMapper.selectPosttiongradeList(fcompanyid);
	}
	/**
	 * 增加职级职等信息
	 */
	@Override
	public int addPositionggrade(Positiongrade positiongrade) {
		// TODO Auto-generated method stub
		return positiongradeMapper.insertSelective(positiongrade);
	}
	/**
	 * 根据fid查找职级职等的信息
	 */
	@Override
	public Positiongrade queryPositiongradeByFid(String fid) {
		// TODO Auto-generated method stub
		return positiongradeMapper.selectByPrimaryKey(fid);
	}
	/**
	 * 修改职级职等信息
	 */
	@Override
	public int updatePositiongradeByFid(Positiongrade positiongrade) {
		// TODO Auto-generated method stub
		return positiongradeMapper.updateByPrimaryKeySelective(positiongrade);
	}
	/**
	 * 删除职级职等信息
	 */
	@Override
	public int deletePositiongradeByFid(String fid) {
		// TODO Auto-generated method stub
		return positiongradeMapper.deleteByPrimaryKey(fid);
	}
	@Override
	public List<Positiongrade> selectPositiongradeByFname(String fnameL2,String companyId) {
		// TODO Auto-generated method stub
		Map<String, String> map = new HashMap<>();
		map.put("fnameL2", fnameL2);
		map.put("fid", companyId);
		return positiongradeMapper.selectPositiongradeByFname(map);
	}
	@Override
	public String selectFnumber(String companyId) {
		// TODO Auto-generated method stub
		return positiongradeMapper.selectFnumber(companyId);
	}
	@Override
	public List<Positiongrade> queryZjzdByCompanyId(String companyId) {
		// TODO Auto-generated method stub
		return positiongradeMapper.selectZjzdByCompanyId(companyId);
	}
	@Override
	public List<Positiongrade> queryZjzdByCompanyIdAndFnameL2(String companyId, String fnameL2) {
		// TODO Auto-generated method stub
		Map<String, String> map = new HashMap<>();
		map.put("companyId", companyId);
		map.put("fnameL2", fnameL2);
		return positiongradeMapper.selectZjzdByCompanyIdAndFnameL2(map);
	}
	

}
